﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace KELT.Controls.Timeline.TimelineChart
{
    public class PageObject : Control
    {
        static PageObject()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(PageObject), new FrameworkPropertyMetadata(typeof(PageObject)));
        }

        public PageObject()
        {

        }

        #region DependencyProperty
        public static DependencyProperty StartTimeProperty { private set; get; }
        public static DependencyProperty EndTimeProperty { private set; get; }
        public static DependencyProperty DurationProperty { private set; get; }
        public static DependencyProperty PageConvertionDurationProperty { private set; get; }

        public int StartTime
        {
            set 
            {
                if (value < 0)
                    value = 0;
                SetValue(StartTimeProperty, value);
            }
            get { return (int)GetValue(StartTimeProperty); }
        }

        public int EndTime
        {
            set { SetValue(EndTimeProperty, value); }
            get { return (int)GetValue(EndTimeProperty); }
        }

        public int Duration
        {
            set { SetValue(DurationProperty, value); }
            get { return (int)GetValue(DurationProperty); }
        }

        public int PageConvertionDuration
        {
            set { SetValue(PageConvertionDurationProperty, value); }
            get { return (int)GetValue(PageConvertionDurationProperty); }
        }

        static void OnStartTimeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            (obj as PageObject).OnStartTimeChanged(args);
        }

        void OnStartTimeChanged(DependencyPropertyChangedEventArgs args)
        {

        }

        static void OnEndTimeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            (obj as PageObject).OnEndTimeChanged(args);
        }

        void OnEndTimeChanged(DependencyPropertyChangedEventArgs args)
        {

        }

        static void OnDurationChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            (obj as PageObject).OnDurationChanged(args);
        }

        void OnDurationChanged(DependencyPropertyChangedEventArgs args)
        {

        }

        static void OnPageConvertionDurationChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            (obj as PageObject).OnPageConvertionDurationChanged(args);
        }

        void OnPageConvertionDurationChanged(DependencyPropertyChangedEventArgs args)
        {

        }


        #endregion
    }
}
